<?php
/**
 * Created by PhpStorm.
 * User: lenove
 * Date: 2018/12/6
 * Time: 14:39
 */
header("Access-Control-Allow-Origin:*");
header("Content-Type:application/json;charset=utf-8");

$HostName="127.0.0.1";
$dbRoot="root";
$dbPwd="";
$dbName="moonbasa";
$dbPort="3306";
//建立连接
$conn=new mysqli($HostName,$dbRoot,$dbPwd,$dbName,$dbPort);
//2.设置编码
mysqli_query($conn,"set names utf8");